Reference

<atomic>

macro
<atomic>

ATOMIC_VAR_INIT

ATOMIC_VAR_INIT(val)
Initialization of atomic variable
This macro expands to a token sequence suitable to initialize an atomic object (of static storage duration) with a value of val.

This macro exists for compatibility with C implementations, in which it is used as a constructor-like function for (default-constructed) atomic objects; In C++, this initialization may be performed directly by the initialization constructor .

Parameters

val
Value to use for initialization.
The object contained in the atomic object shall support constant initialization from this value.

Return value

A sequence of tokens suitable to initialize an atomic object with val.

Data races

This macro does not prevent data races on the object being initialized.

Exception safety

No-throw guarantee: never throws exceptions.

See also

atomic_init
Initialize atomic object (function)
atomic::atomic
Construct atomic (public member function)
ATOMIC_FLAG_INIT
Initialization of atomic flag (macro)

AltStyle によって変換されたページ (->オリジナル) /